package com.ruoyi.wetest.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 压测事务统计记录对象 wetest_stress_trans_metric
 * 
 * @author ruoyi
 * @date 2024-05-07
 */
public class WetestStressTransMetric extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 记录rid */
    @Excel(name = "记录rid")
    private String testId;

    /** 序号 */
    @Excel(name = "序号")
    private Long number;

    /** 事务名 */
    @Excel(name = "事务名")
    private String transName;

    /** 总数 */
    @Excel(name = "总数")
    private Long rxPacks;

    /** 成功数 */
    @Excel(name = "成功数")
    private Long succNum;

    /** 失败数 */
    @Excel(name = "失败数")
    private Long failNum;

    /** 错误数 */
    @Excel(name = "错误数")
    private Long errorNum;

    /** 超时数 */
    @Excel(name = "超时数")
    private Long timeoutNum;

    /** 成功率 */
    @Excel(name = "成功率")
    private BigDecimal succRate;

    /** TPS */
    @Excel(name = "TPS")
    private BigDecimal tps;

    /** 最大耗时 */
    @Excel(name = "最大耗时")
    private Long maxCost;

    /** 最小耗时 */
    @Excel(name = "最小耗时")
    private Long minCost;

    /** 平均耗时 */
    @Excel(name = "平均耗时")
    private BigDecimal avgCost;

    /** 50%耗时 */
    @Excel(name = "50%耗时")
    private Long p50;

    /** 75%耗时 */
    @Excel(name = "75%耗时")
    private Long p75;

    /** 90%耗时 */
    @Excel(name = "90%耗时")
    private Long p90;

    /** 95%耗时 */
    @Excel(name = "95%耗时")
    private Long p95;

    /** 99%耗时 */
    @Excel(name = "99%耗时")
    private Long p99;

    /** 99.9%耗时 */
    @Excel(name = "99.9%耗时")
    private Long p999;

    /** 记录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd yyyy-MM-dd HH:mm:ss")
    @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date cTime;

    /**
     * 预期tps
     */
    private Double expectTps;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setTestId(String testId) 
    {
        this.testId = testId;
    }

    public String getTestId() 
    {
        return testId;
    }
    public void setNumber(Long number) 
    {
        this.number = number;
    }

    public Long getNumber() 
    {
        return number;
    }
    public void setTransName(String transName) 
    {
        this.transName = transName;
    }

    public String getTransName() 
    {
        return transName;
    }
    public void setRxPacks(Long rxPacks) 
    {
        this.rxPacks = rxPacks;
    }

    public Long getRxPacks() 
    {
        return rxPacks;
    }
    public void setSuccNum(Long succNum) 
    {
        this.succNum = succNum;
    }

    public Long getSuccNum() 
    {
        return succNum;
    }
    public void setFailNum(Long failNum) 
    {
        this.failNum = failNum;
    }

    public Long getFailNum() 
    {
        return failNum;
    }
    public void setErrorNum(Long errorNum) 
    {
        this.errorNum = errorNum;
    }

    public Long getErrorNum() 
    {
        return errorNum;
    }
    public void setTimeoutNum(Long timeoutNum) 
    {
        this.timeoutNum = timeoutNum;
    }

    public Long getTimeoutNum() 
    {
        return timeoutNum;
    }
    public void setSuccRate(BigDecimal succRate) 
    {
        this.succRate = succRate;
    }

    public BigDecimal getSuccRate() 
    {
        return succRate;
    }
    public void setTps(BigDecimal tps) 
    {
        this.tps = tps;
    }

    public BigDecimal getTps() 
    {
        return tps;
    }
    public void setMaxCost(Long maxCost) 
    {
        this.maxCost = maxCost;
    }

    public Long getMaxCost() 
    {
        return maxCost;
    }
    public void setMinCost(Long minCost) 
    {
        this.minCost = minCost;
    }

    public Long getMinCost() 
    {
        return minCost;
    }
    public void setAvgCost(BigDecimal avgCost) 
    {
        this.avgCost = avgCost;
    }

    public BigDecimal getAvgCost() 
    {
        return avgCost;
    }
    public void setP50(Long p50) 
    {
        this.p50 = p50;
    }

    public Long getP50() 
    {
        return p50;
    }
    public void setP75(Long p75) 
    {
        this.p75 = p75;
    }

    public Long getP75() 
    {
        return p75;
    }
    public void setP90(Long p90) 
    {
        this.p90 = p90;
    }

    public Long getP90() 
    {
        return p90;
    }
    public void setP95(Long p95) 
    {
        this.p95 = p95;
    }

    public Long getP95() 
    {
        return p95;
    }
    public void setP99(Long p99) 
    {
        this.p99 = p99;
    }

    public Long getP99() 
    {
        return p99;
    }
    public void setP999(Long p999) 
    {
        this.p999 = p999;
    }

    public Long getP999() 
    {
        return p999;
    }
    public void setcTime(Date cTime) 
    {
        this.cTime = cTime;
    }

    public Date getcTime() 
    {
        return cTime;
    }


    public Double getExpectTps() {
        return expectTps;
    }

    public void setExpectTps(Double expectTps) {
        this.expectTps = expectTps;
    }

    public WetestStressTransMetric(String testId, Long number, String transName, Long rxPacks, Long succNum, Long failNum, Long errorNum, Long timeoutNum, BigDecimal succRate, BigDecimal tps, Long maxCost, Long minCost, BigDecimal avgCost, Long p50, Long p75, Long p90, Long p95, Long p99, Long p999, Date cTime) {
        this.testId = testId;
        this.number = number;
        this.transName = transName;
        this.rxPacks = rxPacks;
        this.succNum = succNum;
        this.failNum = failNum;
        this.errorNum = errorNum;
        this.timeoutNum = timeoutNum;
        this.succRate = succRate;
        this.tps = tps;
        this.maxCost = maxCost;
        this.minCost = minCost;
        this.avgCost = avgCost;
        this.p50 = p50;
        this.p75 = p75;
        this.p90 = p90;
        this.p95 = p95;
        this.p99 = p99;
        this.p999 = p999;
        this.cTime = cTime;
    }

    public WetestStressTransMetric() {
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("testId", getTestId())
            .append("number", getNumber())
            .append("transName", getTransName())
            .append("rxPacks", getRxPacks())
            .append("succNum", getSuccNum())
            .append("failNum", getFailNum())
            .append("errorNum", getErrorNum())
            .append("timeoutNum", getTimeoutNum())
            .append("succRate", getSuccRate())
            .append("tps", getTps())
            .append("maxCost", getMaxCost())
            .append("minCost", getMinCost())
            .append("avgCost", getAvgCost())
            .append("p50", getP50())
            .append("p75", getP75())
            .append("p90", getP90())
            .append("p95", getP95())
            .append("p99", getP99())
            .append("p999", getP999())
            .append("cTime", getcTime())
            .toString();
    }
}
